<script>
  let str = "北京你好北京好北京北"
  let obj = {}
  for (let val of str) {
    if (obj[val]) {
      obj[val] += 1
    } else {
      obj[val] = 1
    }

  }
  // console.log(obj)
  let maxCount = 0
  let maxKey = ""
  for (let key in obj) {
    if (obj[key] > maxCount) {
      maxCount = obj[key]
      maxCount = key

    }

  }
  console.log(maxCount)
  console.log(maxKey)



</script>